var templates = {};

function createEditors(magicWord) {
    editor_type = magicWord;
    magicWord = magicWord === undefined ? "" : magicWord;
    jQuery(document).ready(function() {
        jQuery("textarea.editor").tinymce({
            script_url : "site/resources/js/tinymce/jscripts/tiny_mce/tiny_mce.js",
            theme : "advanced",
            relative_urls : false,
            file_browser_callback : "ccSimpleUploader",
            plugin_ccSimpleUploader_upload_path : "../../../../../../upload",
            plugin_ccSimpleUploader_upload_substitute_path : "http://www.hungarianexporters.hu/site/resources/upload/",
            plugins : "impex_templates,advimage,ccSimpleUploader,paste",
            impex_templates_magic_word : magicWord,
            theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
            theme_advanced_buttons2 : "ccSimpleUploader,|,cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,|,impex_templates",
            theme_advanced_toolbar_location : "top",
            theme_advanced_toolbar_align : "left",
            theme_advanced_statusbar_location : "bottom",
            paste_auto_cleanup_on_paste : true,
            paste_convert_middot_lists : false,
            paste_text_sticky : true,
            paste_strip_class_attributes : "all",
            paste_remove_styles : true,
            paste_remove_spans : true,
            paste_block_drop : true,
            setup : function(ed) {
                ed.onChange.add(function(ed, l) {
                    if (typeof(window[ed.id + "_changed"]) == "function") {
                        window[ed.id + "_changed"](l.content);
                    }
                });
             }
        });
    });
}
